#include "StdAfx.h"
#include "FramCon.h"
#include "Imagehandle.h"
CFramCon::CFramCon(CString iFramPath,CString iFramName,int Num,CDC *pDC)
{
	m_FramName=iFramName;
	m_FramPath=iFramPath+iFramName;
	m_Num=Num;
	IImage* temp=LoadImageFromFile(m_FramPath);
	if(temp!=NULL)
	{
		m_Bitmap.CreateCompatibleBitmap(pDC,33,33);
		CDC MemDC;
		MemDC.CreateCompatibleDC(pDC);
		MemDC.SelectObject(&m_Bitmap);
		CRect rect;
		rect.SetRect(0,0,33,33);
		temp->Draw(MemDC.m_hDC,rect,NULL);
		temp->Release();
	}
}

CFramCon::~CFramCon(void)
{
}
void CFramCon::Draw(CDC *hDC,int Num)
{
	if(m_Num-Num<6&&m_Num>=Num)
	{
			int tmp=m_Num-Num;
			CDC MemDC;
			MemDC.CreateCompatibleDC(hDC);
			MemDC.SelectObject(&m_Bitmap);
			hDC->BitBlt(12+tmp*36,7,33,33,&MemDC,0,0,SRCCOPY);
	}
}